<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<head>
<title>聯系我們管理</title>
<style type="text/css">
form fieldset{
	display: none;
}
form fieldset.defaultForm{
	display: block;
}
</style>
<script type="text/javascript" src="${ctx}/extends/ckeditor/ckeditor.js"></script>
<script type="text/javascript">
// The instanceReady event is fired, when an instance of CKEditor has finished
// its initialization.
CKEDITOR.on( 'instanceReady', function( ev ) {

});
</script>
<%@ include file="/common/header.jsp" %>
    <div class="content-box">
      <!-- Start Content Box -->
      <div class="content-box-header">
        <h3>添加聯系</h3>
        <div class="clear"></div>
      </div>
      <!-- End .content-box-header -->
      <div class="content-box-content">
          <form action="${ctx }/company/save.do" method="post">
          	<input type="hidden" id="flag" name="flag" value="${flag }">
	          <c:set var="companyNo">
		          <c:choose>
		          	<c:when test="${empty zh.companyNo}">${en.companyNo}</c:when>
		          	<c:when test="${empty en.companyNo }">${zh.companyNo}</c:when>
		          	<c:otherwise>${en.companyNo}</c:otherwise>
		          </c:choose>
	          </c:set> 
            <fieldset class="zh-company <c:if test="${defaultForm eq 'zh'}">defaultForm</c:if>" >
            <div class="block-layout">           
              <label>編號: ${companyNo }</label>
              <input type="hidden" name="zh.companyId"  value="${zh.companyId }"/>     
              <input type="hidden" name="zh.companyNo"  value="${companyNo }"/>
              <input type="hidden" name="zh.flag"  value="${flag }"/>           
            <p>
              <label for="zh_languageId" >語言</label>
              <select name="zh.languageId"  id="zh_languageId"  class="bigger-input">
              	<c:forEach items="${language }"  var="l">
              		<option value="${l.languageId }"  data-key="${l.languageKey }"  <c:if test="${l.languageKey eq 'zh'}">selected='selected'</c:if>>${l.languageName }</option>
              	</c:forEach>
              </select>
            </p>
            <p>
              <label>名稱：</label>
              <input class="text-input bigger-input" name="zh.companyName"  value="${zh.companyName}"/>
            </p>
            <p>
              <label>地址：</label>
              <input class="text-input bigger-input" name="zh.companyAddress"  value="${zh.companyAddress}"/>
            </p>
            <p>
              <label>電話：</label>
              <input class="text-input bigger-input" name="zh.companyTel"  value="${zh.companyTel}"/>
            </p> 
            </div><div  class="block-layout">
            <label>&nbsp;</label>
            <p>
              <label>傳真：</label>
              <input class="text-input bigger-input" name="zh.companyFax"  value="${zh.companyFax}"/>
            </p>  
            <p>
              <label>電郵：</label>
              <input class="text-input bigger-input" name="zh.companyEmail"  value="${zh.companyEmail}"/>
            </p>    
            <p>
              <label>公司網頁：</label>
              <input class="text-input bigger-input" name="zh.companyUrl"  value="${zh.companyUrl}"/>
            </p>
            </div>
            <div class="clear"></div>
            <p>
              <label>詳情：</label>
              <textarea class="text-input textarea"  name="zh.companyInfo" cols="79" rows="15" >${zh.companyInfo }</textarea>
              <script type="text/javascript">
				// Replace the <textarea id="textarea_content"> with an CKEditor instance.
				CKEDITOR.replace( 'zh.companyInfo',{language: "zh"});
			  </script>           	
            </p>          
            </fieldset>
            <div class="clear"></div>
            <!-- End .clear -->
             <fieldset class="en-company <c:if test="${defaultForm eq 'en'}">defaultForm</c:if>">           
             <div class="block-layout">
              <label>No: ${companyNo }</label>
                <input type="hidden" name="en.companyId"  value="${en.companyId }"/>     
              <input type="hidden" name="en.companyNo"  value="${companyNo }"/>  
              <input type="hidden" name="en.flag"  value="${flag }"/>          
            <p>
              <label for="en_languageId" >Language</label>
              <select name="en.languageId"  id="en_languageId" class="bigger-input">
              	<c:forEach items="${language }"  var="l">
              		<option value="${l.languageId }"   data-key="${l.languageKey }" <c:if test="${l.languageKey eq 'en'}">selected='selected'</c:if>>${l.languageName }</option>
              	</c:forEach>
              </select>
            </p>
            <p>
              <label>Name：</label>
              <input class="text-input bigger-input" name="en.companyName"  value="${en.companyName}"/>
            </p>
            <p>
              <label>Address：</label>
              <input class="text-input bigger-input" name="en.companyAddress"  value="${en.companyAddress}"/>
            </p>
            <p>
              <label>Telephone：</label>
              <input class="text-input bigger-input" name="en.companyTel"  value="${en.companyTel}"/>
            </p> 
            </div><div  class="block-layout">
            <label>&nbsp;</label>
            <p>
              <label>Tax：</label>
              <input class="text-input bigger-input" name="en.companyFax"  value="${en.companyFax}"/>
            </p>  
            <p>
              <label>E-Mail：</label>
              <input class="text-input bigger-input" name="en.companyEmail"  value="${en.companyEmail}"/>
            </p>    
            <p>
              <label>Company Website：</label>
              <input class="text-input bigger-input" name="en.companyUrl"  value="${en.companyUrl}"/>
            </p>
            </div>
            <div class="clear"></div>
            <p>
              <label>Detail：</label>
              <textarea class="text-input textarea"  name="en.companyInfo" cols="79" rows="15" >${en.companyInfo }</textarea>
              <script type="text/javascript">
				// Replace the <textarea id="textarea_content"> with an CKEditor instance.
				CKEDITOR.replace( 'en.companyInfo',{language: "en"});
			  </script>           	
            </p>
            </fieldset>
            <p>
              <input class="button" type="submit" value="Submit" />
            </p>
            <div class="clear"></div>
          </form>
      </div>
      <!-- End .content-box-content -->
    </div>
    <!-- End .content-box -->   
    <div class="clear"></div>
 <%@ include file="/common/footer.jsp" %>
 <script type="text/javascript" src="${ctx}/extends/jquery.json-2.3.js?_=${radom}"></script>
<script type="text/javascript" src="${ctx}/js/companyAdd.js?_=${radom}"></script>
  <script type="text/javascript">
 $(function(){
	 $("#main-nav a[data-menu='contactUs']").addClass("current");
 })
 </script>